﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HPIT_Library
{
    public partial class TypeAdd : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var userName = TextBox1.Text;
            if (userName!="")
            {
                var num = HPIT_Library_BLL.categoryManger.Insert(userName);
                if (num > 0)
                {


                    Response.Write("<script>alert('添加成功！');location.href='type.aspx'</script>");
                }
                else
                {
                    Label1.Text = "";
                }
            }
            else
            {
                Response.Write("<script>alert('添加类别为空！');</script>");
            }
           
        }
    }
}